package datamodel;

import communication.Parameter;
import communication.RestFulService;

public class ServiceHelper {
	public static String getParameterList(RestFulService service) {
		String parameterList = "";
		for (int index = 0; index < service.getParameters().size(); index++) {
			Parameter parameter = service.getParameters().get(index);
			parameterList += "@RequestParam(\"" + parameter.getName() + "\") "
					+ parameter.getParameterType().getName() + " "
					+ parameter.getName();
			if (index != service.getParameters().size() - 1) {
				parameterList += ",\n";
			}
		}
		return parameterList;
		//TODO: Do something here
		
	}
	
	public static String getParameterOfCallStatement(RestFulService service) {
		String parameterList = "";
		for (int index = 0; index < service.getParameters().size(); index++) {
			Parameter parameter = service.getParameters().get(index);
			parameterList += parameter.getName();
			if (index != service.getParameters().size() - 1) {
				parameterList += ", ";
			}
		}
		return parameterList;
	}
}
